﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="GenerateBillReport.aspx.cs" Inherits="Billing.GenerateBillReport" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/Controls/ucHighlight.ascx" TagName="ucHighlight" TagPrefix="uc3" %>
<%@ Register Src="~/Controls/ucPageTitle.ascx" TagName="ucPageTitle" TagPrefix="uc4" %>
<%@ Register Src="~/Controls/ucInProgress.ascx" TagName="ucInProgress" TagPrefix="uc5" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel runat="server" ID="updatePanel1">
        <ContentTemplate>
            <uc3:ucHighlight ID="ucHighlight1" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <uc4:ucPageTitle ID="ucPageTitle1" runat="server" />
    <asp:UpdatePanel runat="server" ID="updatePanel2">
        <ContentTemplate>
            <table cellpadding="0" cellspacing="3" width="100%">
                <tr>
                    <td align="left" width="90px">
                        Billing Period:&nbsp;
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlBillPeriod" runat="server" AutoPostBack="True">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td align="left" width="90px">
                        Agency:&nbsp;
                    </td>
                    <td align="left" nowrap valign="top">
                        <asp:UpdatePanel ID="updatePanel7" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlAgency" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlAgency_SelectedIndexChanged">
                                </asp:DropDownList>
                                &nbsp; BU:&nbsp;
                                <asp:DropDownList ID="ddlBU" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlBU_SelectedIndexChanged">
                                </asp:DropDownList>
                                &nbsp; Cost Centre:&nbsp;
                                <asp:DropDownList ID="ddlCostCentre" runat="server" AutoPostBack="True">
                                </asp:DropDownList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
            </table>
            <br>
            <asp:CheckBox ID="chkboxOverwriteReport" runat="server" Text="Overwrite the existing report(s)" />
            <br />
            <br />
            Available reports:<br />
            <asp:GridView ID="gvwReports" runat="server" CellPadding="0" CellSpacing="1" CssClass="GridViewStyle" GridLines="None" 
                AutoGenerateColumns="False" EnableModelValidation="True" AllowSorting="True" onsorting="gvwReports_Sorting">
                <RowStyle CssClass="GridViewRowStyle" />
                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                <HeaderStyle CssClass="GridViewHeaderStyle" />
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:CheckBox ID="GRChkBox" runat="server" 
                                Checked="false"/>
                        </ItemTemplate>
                        <HeaderTemplate>
                            <asp:CheckBox ID="GRChkALL" runat="server" AutoPostBack="True" OnCheckedChanged="GRChkALL_CheckedChanged"
                                ToolTip="Select or deselect all reports" Checked="false"/>
                        </HeaderTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="40" />
                        <ItemStyle HorizontalAlign="Center" Width="40"/>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="No" >
                        <ItemTemplate>
                            <asp:Label ID="xCol01" runat="server" Text="<%#Container.DataItemIndex + 1%>"></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" Width="30" />
                        <ItemStyle Width="30"/>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Report Name"
                        SortExpression="ReportName">
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:Label ID="xCol02" runat="server" Text='<%#Eval("ReportName")%>'></asp:Label>
                            <asp:Label ID="lblReportTemplateID" runat="server" Text='<%#Eval("ID")%>' Visible="False"></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Format"
                        SortExpression="RenderFormat">
                        <ItemTemplate>
                            <asp:Label ID="xCol03" runat="server" Text='<%#Eval("RenderFormat")%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center"/>
                    </asp:TemplateField>
                    
                </Columns>

            </asp:GridView>
            <br />
            <asp:Button ID="BtnGenerate" runat="server" CssClass="ui-state-default ui-corner-all"
                Text="Generate" Visible="True" onclick="BtnGenerate_Click" />
            <asp:ConfirmButtonExtender ID="BtnGenerate_ConfirmButtonExtender" runat="server"
                ConfirmText="Click OK to gererate report" TargetControlID="BtnGenerate">
            </asp:ConfirmButtonExtender>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="updateprogress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
        <ProgressTemplate>
            <uc5:ucInProgress ID="ucInProgress1" runat="server" />
        </ProgressTemplate>
    </asp:UpdateProgress>

    <rsweb:reportviewer ID="ReportViewer1" runat="server" Visible="False">
    </rsweb:reportviewer>

</asp:Content>
